package yf.mall.enums.app;

import java.util.Objects;
import java.util.stream.Stream;

public enum AppOrderDateTypeEnum {

    PAY_TIME(1, "支付时间"),

    SETTLE_TIME(2, "结算时间");

    int type;

    String value;

    AppOrderDateTypeEnum(int type, String value) {
        this.type = type;
        this.value = value;
    }

    public int getType() {
        return type;
    }

    public String getValue() {
        return value;
    }

    public static final AppOrderDateTypeEnum getByKey(Integer type) {
        return Stream.of(AppOrderDateTypeEnum.values()).filter(typeEnum -> Objects.equals(type, typeEnum.type)).findFirst().orElse(null);
    }
}
